home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
amac44a.zip
/
MIS004.QM
< prev
next >
Wrap
Text File
|
1991-11-24
|
11KB
|
228 lines
* mis004.qm
* Miscellaneous Macros to Compare Files
* Written By Tom Hogshead
* [ See MISCxx.QM For Use ]
* 11/24/91
* Key Subfile Description
* ===== ========= ==============================================
* @(1) Compare Two Files: Compares contents of two files and shows in |new
* the Nul file, as they are found, all
* different lines in file #1 whose first 59
* characters are NOT contained anywhere in file #2.
* @(2) Compare Each Line of Two Files on a Line by Line Basis: |new
* Compares contents of two files on a line by
* line basis displaying only lines in file #1
* different than the same line number in file #2.
* @(3) Compare Each Line of Two Files on a Line by Line Basis |new
* Pausing at Each Different Line:
* Compares contents of two files on a line by
* line basis pausing at each line in file #1
* different than the same line number in file #2.
* @(4) Compare Two Files Pausing at Each Different Line, |new
* Does Not Get "Unsynchronized":
* Compares contents of two files pausing at
* each line in file #1 that does not exist in
* file #2. Does not get "unsynchronized" or
* confused.
*
* {e:\up\MISC*}--Return To MISCxx.QM
*
*-- eoi
* Macros @1 to @4m written at the request of Jim Bates on
* Smartnet, compare contents of two files:
*
* Files #1, #2 and Nul are quit by pressing <enter> at
* macro completion. Remove "setscreenOFF|ON" if you are not
* using QEdit v2.15. Swap last two lines if you have Qconfig
* set to NOT close windows on quit. "Find" dialog box is
* limited to 59 characters, thus any file difference in columns
* 60+ will not be detected.
* Speed of these macros depends on file sizes being
* compared, the number of different lines, Qconfig setup and
* hardware. If beeps are set ON, file differences will be
* heard but this can slow down macro speed more than 200%.
* Macro @1 will run approximately 40% faster, by removing the
* second setscreenoff line -- detecting approximately 40
* different lines per second on a 12 mhz AT.
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Compare Two Files
* ----------------------------------------------------------------------
* This macro compares the contents of two files and shows in the Nul
* file, as they are found, all different lines in file #1 (entered at
* first pause) whose first 59 characters are NOT contained anywhere in
* file #2 (entered at second pause).
@1 macrobegin
setscreenoff
onewindow endline unmarkblock dropanchor
editfile "nul" return quit gotoblockbeg unmarkblock
setscreenon
editfile delline pause return begfile insertline horizontalwindow
editfile delline pause return begfile insertline horizontalwindow
editfile "nul" return begfile zoomwindow
setscreenoff
nextwindow
A: endline begline jtrue B cursordown jfalse END jump A
B: dropanchor endline copy
nextwindow find paste return "G" return jfalse D
prevwindow
C: cursordown jfalse END jump A
D: nextwindow paste unmarkblock zoomwindow endfile
setscreenon setscreenoff * Remove line to increase macro speed
nextwindow jump C
END: prevwindow zoomwindow unmarkblock begfile setscreenon
pause
quit quit quit onewindow
* *---- Use this line if Qconfig set to NOT close windows on quit ----*
* quit closewindow quit closewindow quit closewindow onewindow
*
* 105 bytes Sun 11-03-1991 22:29:52 (TH @1, ver 1)
* 101 bytes Tue 11-05-1991 11:05:19 (TH @1, shortened, for all Qconfig's)
*
* ----------------------------------------------------------------------
* @(2) Compare Each Line of Two Files on a Line by Line Basis
* ----------------------------------------------------------------------
* This macro compares the contents of two files on a line by line
* basis. All lines in file #1 (entered at first pause) whose first 59
* characters do not exist in the same line number in file #2 (entered
* at second pause) are shown in the Nul file as found.
* @2 differs from @1 in that @1 only shows lines whose first 59
* characters do not exist ANYWHERE in file #2. Macro @2 shows all
* lines in file #1 whose first 59 characters do not exist in the same
* line number in file #2. Capitalized lines show differences from @1.
@2 macrobegin
setscreenoff
onewindow endline unmarkblock dropanchor
editfile "nul" return quit gotoblockbeg unmarkblock
setscreenon
editfile delline pause return begfile insertline horizontalwindow
editfile delline pause return begfile insertline horizontalwindow
editfile "nul" return begfile zoomwindow
setscreenoff
nextwindow
A: endline begline jtrue B cursordown jfalse END
NEXTWINDOW CURSORDOWN PREVWINDOW jump A
B: dropanchor endline copy
nextwindow
MARKLINE ENDLINE CURSORRIGHT
FIND PASTE RETURN "BL" RETURN JFALSE D
CURSORDOWN
prevwindow
C: cursordown jfalse END jump A
D: CURSORDOWN nextwindow paste unmarkblock zoomwindow endfile
setscreenon setscreenoff * Remove line to increase macro speed
nextwindow jump C
END: prevwindow zoomwindow unmarkblock begfile setscreenon
pause
quit quit quit onewindow
* *---- Use this line if Qconfig set to NOT close windows on quit ----*
* quit closewindow quit closewindow quit closewindow onewindow
*
* 111 bytes Mon 11-04-1991 21:06:40 (TH @2)
*
* ----------------------------------------------------------------------
* @(3) Compare Each Line of Two Files on a Line by Line Basis Pausing
* at Each Different Line
* ----------------------------------------------------------------------
* This macro compares the contents of two files on a line by line basis
* and pauses at each line in file #1 that is different than the same
* line number in file #2. Press <enter> to move to and pause the next
* different line. After all different lines have been found, then a
* list of all the different lines in file #1 (entered at first pause)
* whose first 59 characters do not exist in the same line number in
* file #2 (entered at second pause) are shown in the Nul file. Press
* <enter> to quit file #1, #2 and Nul, and finally end the macro by
* return to starting file.
* @3 differs from @2 in that it pauses at each different line in file
* #1 and can get unsynchronized at the point corrresponding line
* numbers do not match. Macro @2 only shows a list of all
* different lines in file #1 as they are found and whose first 59
* characters do not exist in the same line number in file #2.
@3 macrobegin
setscreenoff
onewindow endline unmarkblock dropanchor
editfile "nul" return quit gotoblockbeg unmarkblock
setscreenon
editfile delline pause return begfile insertline horizontalwindow
editfile delline pause return begfile insertline horizontalwindow
editfile "nul" return begfile zoomwindow
setscreenoff
nextwindow
A: endline begline jtrue B cursordown jfalse END
NEXTWINDOW CURSORDOWN PREVWINDOW jump A
B: dropanchor endline copy
nextwindow
MARKLINE ENDLINE CURSORRIGHT
FIND PASTE RETURN "BL" RETURN JFALSE D
CURSORDOWN
prevwindow
C: cursordown jfalse END jump A
D: CURSORDOWN PREVWINDOW ZOOMWINDOW SETSCREENON
PAUSE
SETSCREENOFF SETSCREENON SETSCREENOFF * Removes "P", turns off screen
PREVWINDOW PASTE ENDFILE
nextwindow jump C
END: prevwindow zoomwindow unmarkblock begfile setscreenon
pause
quit quit quit onewindow
* *---- Use this line if Qconfig set to NOT close windows on quit ----*
* quit closewindow quit closewindow quit closewindow onewindow
*
* 114 bytes Mon 11-04-1991 20:46:57 (TH @3)
*
* ----------------------------------------------------------------------
* @(4) Compare Two Files Pausing at Each Different Line,
* Does Not Get "Unsynchronized"
* ----------------------------------------------------------------------
* This macro compares the contents of two files and pauses at each line
* in file #1 that does not exist anywhere in file #2. Press <enter> to
* move to and pause the next different line in file #1. After all
* different lines have been found, then a list of all the different
* lines in file #1 (entered at first pause) whose first 59 characters
* do not exist in the same line number in file #2 (entered at second
* pause) are shown in the Nul file. Press <enter> to quit file #1, #2
* and Nul, and finally end the macro by return to starting file.
* @4 differs from @3 in that it does not get "unsynchronized" or
* confused if text is not found on the same line in file #2. It does a
* Global "G" search, and if text is found anywhere in file #2 it
* considers that found text as the corresponding line in file #1.
@4 macrobegin
setscreenoff
onewindow endline unmarkblock dropanchor
editfile "nul" return quit gotoblockbeg unmarkblock
setscreenon
editfile delline pause return begfile insertline horizontalwindow
editfile delline pause return begfile insertline horizontalwindow
editfile "nul" return begfile zoomwindow
setscreenoff
nextwindow
A: endline begline jtrue B cursordown jfalse END jump A
B: dropanchor endline copy
nextwindow Find paste return "G" return jfalse D
prevwindow
C: cursordown jfalse END jump A
D: PREVWINDOW ZOOMWINDOW SETSCREENON
PAUSE
SETSCREENOFF SETSCREENON SETSCREENOFF * Removes "P", turns off screen
PREVWINDOW PASTE ENDFILE
nextwindow jump C
END: prevwindow zoomwindow unmarkblock begfile setscreenon
pause
quit quit quit onewindow
* *---- Use this line if Qconfig set to NOT close windows on quit ----*
* quit closewindow quit closewindow quit closewindow onewindow
*
* 104 bytes Tue 11-05-1991 11:15:49 (TH @4)